<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<img src="http://dev.argi-cloud.com/qujing/jinyangqu/resources/10de84f1-8dba-4b72-bea9-c5f6be64b174null">
</body>
<script >
    var sock = new SockJS(contextPath + 'websocket?token=' + token); //连接节点
    var stomp = Stomp.over(sock);
    stomp.connect({}, function (frame) {
        //连接成功后订阅消息接口 //订阅个人消息
        stomp.subscribe('/user/queue/msg/new', function (response) {
            var result = response.body; //TODO something }); //消息发送结果
            stomp.subscribe('/user/queue/msg/result', function (response) {
            }); //订阅广播消息
            stomp.subscribe('/topic/notice', function (response) {
            });
        });
        //发送广播
        stomp.send('/app/addNotice', {}, '广播内容'); //发送消息
        var msg = {toName: '接收人', content: '消息内容'};
        stomp.send('/app/msg', {}, JSON.stringify(msg));
    }

</script>
</html>